using MediatR;
using System.Collections.Generic;
using Work.ErrorCode;

namespace Work.API.Applications.Write.Commands
{
    /// <summary>
    /// 批量创建处方明细命令
    /// </summary>
    public class CreatePrescriptionItemsCommand : IRequest<ApiResult<int>>
    {
        /// <summary>
        /// 预约编号
        /// </summary>
        public int AppointmentId { get; set; }

        /// <summary>
        /// 病历编号（可选）
        /// </summary>
        public int? RecordId { get; set; }

        /// <summary>
        /// 就诊人编号
        /// </summary>
        public int PatientId { get; set; }

        /// <summary>
        /// 挂单号
        /// </summary>
        public string? RegistrationNum { get; set; }

        /// <summary>
        /// 处方明细列表
        /// </summary>
        public List<PrescriptionItemInfo> Items { get; set; } = new List<PrescriptionItemInfo>();

        /// <summary>
        /// 开药医生（可选）
        /// </summary>
        public string? CreateBy { get; set; }
    }

    /// <summary>
    /// 处方明细信息
    /// </summary>
    public class PrescriptionItemInfo
    {
        /// <summary>
        /// 药品名称
        /// </summary>
        public string? MedicineName { get; set; }

        /// <summary>
        /// 单价
        /// </summary>
        public decimal UnitPrice { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public int Quantity { get; set; }
    }
}

